package com.dps.omc.publish;

import com.dps.omc.model.Job;
import com.dps.omc.model.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by lip on 2016-04-11.
 */
public class JobRunThread implements Runnable{

    private static final Logger logger = LoggerFactory.getLogger(JobRunThread.class);

    private JobManager jobManager;
    private Job job;
    private User lastModified;

    public JobRunThread(JobManager jobManager,Job job,User lastModified)
    {

        this.jobManager = jobManager;
        this.job = job;
        this.lastModified = lastModified;
    }

    @Override
    public void run() {
        try {
            this.jobManager.run(this.job,this.lastModified);
        } catch (Exception e) {
            logger.error(e.toString());
        }
    }
}
